﻿#include "pch.h"
#include "ViewModelBase.h"
#include "ViewModelBase.g.cpp"


namespace winrt::NovelReader::implementation
{
    void ViewModelBase::RaisePropertyChanged(hstring const& propertyName)
    {
        m_propertyChanged(*this, winrt::Microsoft::UI::Xaml::Data::PropertyChangedEventArgs(propertyName)); 
    }

    winrt::event_token ViewModelBase::PropertyChanged(winrt::Microsoft::UI::Xaml::Data::PropertyChangedEventHandler const& handler)
    {
        return m_propertyChanged.add(handler); 
    }

    void ViewModelBase::PropertyChanged(winrt::event_token const& token) noexcept
    {
        m_propertyChanged.remove(token); 
    }
}
